package Controller;

import Service.LoginService;

public class LoginController {
    // 调用业务逻辑层
    private LoginService loginService;

    // 构造器
    public LoginController() throws Exception {
        // 创建业务逻辑层对象
        loginService = new LoginService();
    }

// 调用业务逻辑层的管理员登录方法
    public int controllerAdministratorsLogin(String username, String password) throws Exception {
        return loginService.serviceAdministratorsLogin(username,password);
    }

    // 调用业务逻辑层的管理员注册方法
    public Boolean controllerAdministratorsRegister(String username, String password) throws Exception {
        return loginService.serviceAdministratorsRegister(username,password);
    }

    // 调用业务逻辑层的用户登录方法
    public int controllerUserLogin(String username, String password) throws Exception {
        return loginService.serviceUserLogin(username,password);
    }

    // 调用业务逻辑层的用户注册方法
    public Boolean controllerUserRegister(String username, String password,String registrationDate) throws Exception {
        return loginService.serviceUserRegister(username,password,registrationDate);
    }

}
